package com.demo.entity;


import cn.lingyangwl.framework.data.mate.annotations.FieldBind;
import cn.lingyangwl.framework.mybatis.mate.inter.EntityFieldUniqueCheck;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.demo.fieldbind.BindTypeEnum;
import com.demo.fieldbind.CustomFieldBind;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author shenguangyang
 */
@TableName("big_data")
@Getter
@Setter
@ToString
public class BigDataPO implements EntityFieldUniqueCheck {
    @TableId
    private String id;
    private String phone;
    private String userId;
    private String username;
    private String password;
    private String email;
    private String nickname;
    private String avatarUrl;
    private String homeAddress;
    private String idCode;
    private Long lastLogin;
    private Long createTime;
    private Long updateTime;

    /*
     * 默认的字典绑定注解
     */
//    @FieldBind(type = BindTypeConstants.USER_SEX, target = "sexText")
//    private Integer sex;
//
//    @TableField(exist = false)
//    private String sexText;
//
//    @FieldBind(type = BindTypeConstants.USER_STATUS, target = "statusText", delimiter = "|")
//    private String status;

//    @TableField(exist = false)
//    private String statusText;

//    @TableField(exist = false)
//    private StatusEnum statusText;


    /*
     * 自定义字典绑定注解
     */
    @CustomFieldBind(type = BindTypeEnum.USER_SEX, target = "sexText")
    private Integer sex;

    @TableField(exist = false)
    private String sexText;

    @CustomFieldBind(type = BindTypeEnum.USER_STATUS, target = "statusText")
    private String status;

    @TableField(exist = false)
    private String statusText;

//    @TableField(exist = false)
//    private StatusEnum statusText;


    @FieldBind(type = "test1", target = "deleteFlagText")
    private Integer deleteFlag;

    @TableField(exist = false)
    private String deleteFlagText;
}
